#ifndef __TEST_CASE_H__
#define __TEST_CASE_H__

#include <string>
#include <vector>
#include <stdint.h>
#include <iostream>

struct CaseConditions
{
    std::string arch;
    std::string os;
    std::string version;
    std::string charset;
    std::string program;

    friend std::ostream &operator<<(std::ostream &os, const CaseConditions &cds)
    {
        os << "arch: " << cds.arch << ", os: " << cds.os
            << ", version: " << cds.version << ", charset: " << cds.charset
            << ", program: " << cds.program;

        return os;
    }
};

class TestCase
{
public:
    TestCase();
    ~TestCase();

    const std::string &GetName() const;
    void SetName(const std::string &name);

    const CaseConditions &GetConditions() const;
    void SetConditions(const CaseConditions &conditions);

    bool DoTestCase(const CaseConditions &conditions) const;

    const std::string &GetPcap() const;
    void SetPcap(const std::string &pcap);

    void AddCompareData(const std::string &cmpData);
    uint32_t GetCompareDatasNum() const;
    const std::string &GetCompareData(uint32_t idx) const;

    bool GetPassed() const { return passed_;}
    void SetPassed(bool passed) {passed_ = passed;}

    const std::string &GetReason() const {return reason_;}
    void SetReason(const std::string &reason) {reason_ = reason;}

    friend std::ostream &operator<<(std::ostream &os, const TestCase &oneCase);
private:
    std::string name_;
    CaseConditions conditions_;
    std::string pcap_;
    std::vector<std::string> cmpDatas_;
    bool passed_;
    std::string reason_;
};

#endif
